
obj/__user_badarg.out：     文件格式 elf32-i386


Disassembly of section .text:

00800020 <__panic>:
#include <stdio.h>
#include <ulib.h>
#include <error.h>

void
__panic(const char *file, int line, const char *fmt, ...) {
  800020:	f3 0f 1e fb          	endbr32 
  800024:	55                   	push   %ebp
  800025:	89 e5                	mov    %esp,%ebp
  800027:	83 ec 28             	sub    $0x28,%esp
    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
  80002a:	8d 45 14             	lea    0x14(%ebp),%eax
  80002d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("user panic at %s:%d:\n    ", file, line);
  800030:	8b 45 0c             	mov    0xc(%ebp),%eax
  800033:	89 44 24 08          	mov    %eax,0x8(%esp)
  800037:	8b 45 08             	mov    0x8(%ebp),%eax
  80003a:	89 44 24 04          	mov    %eax,0x4(%esp)
  80003e:	c7 04 24 20 12 80 00 	movl   $0x801220,(%esp)
  800045:	e8 6d 03 00 00       	call   8003b7 <cprintf>
    vcprintf(fmt, ap);
  80004a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80004d:	89 44 24 04          	mov    %eax,0x4(%esp)
  800051:	8b 45 10             	mov    0x10(%ebp),%eax
  800054:	89 04 24             	mov    %eax,(%esp)
  800057:	e8 24 03 00 00       	call   800380 <vcprintf>
    cprintf("\n");
  80005c:	c7 04 24 3a 12 80 00 	movl   $0x80123a,(%esp)
  800063:	e8 4f 03 00 00       	call   8003b7 <cprintf>
    va_end(ap);
    exit(-E_PANIC);
  800068:	c7 04 24 f6 ff ff ff 	movl   $0xfffffff6,(%esp)
  80006f:	e8 da 01 00 00       	call   80024e <exit>

00800074 <__warn>:
}

void
__warn(const char *file, int line, const char *fmt, ...) {
  800074:	f3 0f 1e fb          	endbr32 
  800078:	55                   	push   %ebp
  800079:	89 e5                	mov    %esp,%ebp
  80007b:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
  80007e:	8d 45 14             	lea    0x14(%ebp),%eax
  800081:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("user warning at %s:%d:\n    ", file, line);
  800084:	8b 45 0c             	mov    0xc(%ebp),%eax
  800087:	89 44 24 08          	mov    %eax,0x8(%esp)
  80008b:	8b 45 08             	mov    0x8(%ebp),%eax
  80008e:	89 44 24 04          	mov    %eax,0x4(%esp)
  800092:	c7 04 24 3c 12 80 00 	movl   $0x80123c,(%esp)
  800099:	e8 19 03 00 00       	call   8003b7 <cprintf>
    vcprintf(fmt, ap);
  80009e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8000a1:	89 44 24 04          	mov    %eax,0x4(%esp)
  8000a5:	8b 45 10             	mov    0x10(%ebp),%eax
  8000a8:	89 04 24             	mov    %eax,(%esp)
  8000ab:	e8 d0 02 00 00       	call   800380 <vcprintf>
    cprintf("\n");
  8000b0:	c7 04 24 3a 12 80 00 	movl   $0x80123a,(%esp)
  8000b7:	e8 fb 02 00 00       	call   8003b7 <cprintf>
    va_end(ap);
}
  8000bc:	90                   	nop
  8000bd:	c9                   	leave  
  8000be:	c3                   	ret    

008000bf <syscall>:
#include <syscall.h>

#define MAX_ARGS            5

static inline int
syscall(int num, ...) {
  8000bf:	55                   	push   %ebp
  8000c0:	89 e5                	mov    %esp,%ebp
  8000c2:	57                   	push   %edi
  8000c3:	56                   	push   %esi
  8000c4:	53                   	push   %ebx
  8000c5:	83 ec 20             	sub    $0x20,%esp
    va_list ap;
    va_start(ap, num);
  8000c8:	8d 45 0c             	lea    0xc(%ebp),%eax
  8000cb:	89 45 e8             	mov    %eax,-0x18(%ebp)
    uint32_t a[MAX_ARGS];
    int i, ret;
    for (i = 0; i < MAX_ARGS; i ++) {
  8000ce:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  8000d5:	eb 15                	jmp    8000ec <syscall+0x2d>
        a[i] = va_arg(ap, uint32_t);
  8000d7:	8b 45 e8             	mov    -0x18(%ebp),%eax
  8000da:	8d 50 04             	lea    0x4(%eax),%edx
  8000dd:	89 55 e8             	mov    %edx,-0x18(%ebp)
  8000e0:	8b 10                	mov    (%eax),%edx
  8000e2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8000e5:	89 54 85 d4          	mov    %edx,-0x2c(%ebp,%eax,4)
    for (i = 0; i < MAX_ARGS; i ++) {
  8000e9:	ff 45 f0             	incl   -0x10(%ebp)
  8000ec:	83 7d f0 04          	cmpl   $0x4,-0x10(%ebp)
  8000f0:	7e e5                	jle    8000d7 <syscall+0x18>
    asm volatile (
        "int %1;"
        : "=a" (ret)
        : "i" (T_SYSCALL),
          "a" (num),
          "d" (a[0]),
  8000f2:	8b 55 d4             	mov    -0x2c(%ebp),%edx
          "c" (a[1]),
  8000f5:	8b 4d d8             	mov    -0x28(%ebp),%ecx
          "b" (a[2]),
  8000f8:	8b 5d dc             	mov    -0x24(%ebp),%ebx
          "D" (a[3]),
  8000fb:	8b 7d e0             	mov    -0x20(%ebp),%edi
          "S" (a[4])
  8000fe:	8b 75 e4             	mov    -0x1c(%ebp),%esi
    asm volatile (
  800101:	8b 45 08             	mov    0x8(%ebp),%eax
  800104:	cd 80                	int    $0x80
  800106:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "cc", "memory");
    return ret;
  800109:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
  80010c:	83 c4 20             	add    $0x20,%esp
  80010f:	5b                   	pop    %ebx
  800110:	5e                   	pop    %esi
  800111:	5f                   	pop    %edi
  800112:	5d                   	pop    %ebp
  800113:	c3                   	ret    

00800114 <sys_exit>:

int
sys_exit(int error_code) {
  800114:	f3 0f 1e fb          	endbr32 
  800118:	55                   	push   %ebp
  800119:	89 e5                	mov    %esp,%ebp
  80011b:	83 ec 08             	sub    $0x8,%esp
    return syscall(SYS_exit, error_code);
  80011e:	8b 45 08             	mov    0x8(%ebp),%eax
  800121:	89 44 24 04          	mov    %eax,0x4(%esp)
  800125:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80012c:	e8 8e ff ff ff       	call   8000bf <syscall>
}
  800131:	c9                   	leave  
  800132:	c3                   	ret    

00800133 <sys_fork>:

int
sys_fork(void) {
  800133:	f3 0f 1e fb          	endbr32 
  800137:	55                   	push   %ebp
  800138:	89 e5                	mov    %esp,%ebp
  80013a:	83 ec 04             	sub    $0x4,%esp
    return syscall(SYS_fork);
  80013d:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  800144:	e8 76 ff ff ff       	call   8000bf <syscall>
}
  800149:	c9                   	leave  
  80014a:	c3                   	ret    

0080014b <sys_wait>:

int
sys_wait(int pid, int *store) {
  80014b:	f3 0f 1e fb          	endbr32 
  80014f:	55                   	push   %ebp
  800150:	89 e5                	mov    %esp,%ebp
  800152:	83 ec 0c             	sub    $0xc,%esp
    return syscall(SYS_wait, pid, store);
  800155:	8b 45 0c             	mov    0xc(%ebp),%eax
  800158:	89 44 24 08          	mov    %eax,0x8(%esp)
  80015c:	8b 45 08             	mov    0x8(%ebp),%eax
  80015f:	89 44 24 04          	mov    %eax,0x4(%esp)
  800163:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  80016a:	e8 50 ff ff ff       	call   8000bf <syscall>
}
  80016f:	c9                   	leave  
  800170:	c3                   	ret    

00800171 <sys_yield>:

int
sys_yield(void) {
  800171:	f3 0f 1e fb          	endbr32 
  800175:	55                   	push   %ebp
  800176:	89 e5                	mov    %esp,%ebp
  800178:	83 ec 04             	sub    $0x4,%esp
    return syscall(SYS_yield);
  80017b:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  800182:	e8 38 ff ff ff       	call   8000bf <syscall>
}
  800187:	c9                   	leave  
  800188:	c3                   	ret    

00800189 <sys_kill>:

int
sys_kill(int pid) {
  800189:	f3 0f 1e fb          	endbr32 
  80018d:	55                   	push   %ebp
  80018e:	89 e5                	mov    %esp,%ebp
  800190:	83 ec 08             	sub    $0x8,%esp
    return syscall(SYS_kill, pid);
  800193:	8b 45 08             	mov    0x8(%ebp),%eax
  800196:	89 44 24 04          	mov    %eax,0x4(%esp)
  80019a:	c7 04 24 0c 00 00 00 	movl   $0xc,(%esp)
  8001a1:	e8 19 ff ff ff       	call   8000bf <syscall>
}
  8001a6:	c9                   	leave  
  8001a7:	c3                   	ret    

008001a8 <sys_getpid>:

int
sys_getpid(void) {
  8001a8:	f3 0f 1e fb          	endbr32 
  8001ac:	55                   	push   %ebp
  8001ad:	89 e5                	mov    %esp,%ebp
  8001af:	83 ec 04             	sub    $0x4,%esp
    return syscall(SYS_getpid);
  8001b2:	c7 04 24 12 00 00 00 	movl   $0x12,(%esp)
  8001b9:	e8 01 ff ff ff       	call   8000bf <syscall>
}
  8001be:	c9                   	leave  
  8001bf:	c3                   	ret    

008001c0 <sys_putc>:

int
sys_putc(int c) {
  8001c0:	f3 0f 1e fb          	endbr32 
  8001c4:	55                   	push   %ebp
  8001c5:	89 e5                	mov    %esp,%ebp
  8001c7:	83 ec 08             	sub    $0x8,%esp
    return syscall(SYS_putc, c);
  8001ca:	8b 45 08             	mov    0x8(%ebp),%eax
  8001cd:	89 44 24 04          	mov    %eax,0x4(%esp)
  8001d1:	c7 04 24 1e 00 00 00 	movl   $0x1e,(%esp)
  8001d8:	e8 e2 fe ff ff       	call   8000bf <syscall>
}
  8001dd:	c9                   	leave  
  8001de:	c3                   	ret    

008001df <sys_pgdir>:

int
sys_pgdir(void) {
  8001df:	f3 0f 1e fb          	endbr32 
  8001e3:	55                   	push   %ebp
  8001e4:	89 e5                	mov    %esp,%ebp
  8001e6:	83 ec 04             	sub    $0x4,%esp
    return syscall(SYS_pgdir);
  8001e9:	c7 04 24 1f 00 00 00 	movl   $0x1f,(%esp)
  8001f0:	e8 ca fe ff ff       	call   8000bf <syscall>
}
  8001f5:	c9                   	leave  
  8001f6:	c3                   	ret    

008001f7 <sys_gettime>:

int
sys_gettime(void) {
  8001f7:	f3 0f 1e fb          	endbr32 
  8001fb:	55                   	push   %ebp
  8001fc:	89 e5                	mov    %esp,%ebp
  8001fe:	83 ec 04             	sub    $0x4,%esp
    return syscall(SYS_gettime);
  800201:	c7 04 24 11 00 00 00 	movl   $0x11,(%esp)
  800208:	e8 b2 fe ff ff       	call   8000bf <syscall>
}
  80020d:	c9                   	leave  
  80020e:	c3                   	ret    

0080020f <sys_lab6_set_priority>:

void
sys_lab6_set_priority(uint32_t priority)
{
  80020f:	f3 0f 1e fb          	endbr32 
  800213:	55                   	push   %ebp
  800214:	89 e5                	mov    %esp,%ebp
  800216:	83 ec 08             	sub    $0x8,%esp
    syscall(SYS_lab6_set_priority, priority);
  800219:	8b 45 08             	mov    0x8(%ebp),%eax
  80021c:	89 44 24 04          	mov    %eax,0x4(%esp)
  800220:	c7 04 24 ff 00 00 00 	movl   $0xff,(%esp)
  800227:	e8 93 fe ff ff       	call   8000bf <syscall>
}
  80022c:	90                   	nop
  80022d:	c9                   	leave  
  80022e:	c3                   	ret    

0080022f <sys_sleep>:

int
sys_sleep(unsigned int time) {
  80022f:	f3 0f 1e fb          	endbr32 
  800233:	55                   	push   %ebp
  800234:	89 e5                	mov    %esp,%ebp
  800236:	83 ec 08             	sub    $0x8,%esp
    return syscall(SYS_sleep, time);
  800239:	8b 45 08             	mov    0x8(%ebp),%eax
  80023c:	89 44 24 04          	mov    %eax,0x4(%esp)
  800240:	c7 04 24 0b 00 00 00 	movl   $0xb,(%esp)
  800247:	e8 73 fe ff ff       	call   8000bf <syscall>
}
  80024c:	c9                   	leave  
  80024d:	c3                   	ret    

0080024e <exit>:
#include <syscall.h>
#include <stdio.h>
#include <ulib.h>

void
exit(int error_code) {
  80024e:	f3 0f 1e fb          	endbr32 
  800252:	55                   	push   %ebp
  800253:	89 e5                	mov    %esp,%ebp
  800255:	83 ec 18             	sub    $0x18,%esp
    sys_exit(error_code);
  800258:	8b 45 08             	mov    0x8(%ebp),%eax
  80025b:	89 04 24             	mov    %eax,(%esp)
  80025e:	e8 b1 fe ff ff       	call   800114 <sys_exit>
    cprintf("BUG: exit failed.\n");
  800263:	c7 04 24 58 12 80 00 	movl   $0x801258,(%esp)
  80026a:	e8 48 01 00 00       	call   8003b7 <cprintf>
    while (1);
  80026f:	eb fe                	jmp    80026f <exit+0x21>

00800271 <fork>:
}

int
fork(void) {
  800271:	f3 0f 1e fb          	endbr32 
  800275:	55                   	push   %ebp
  800276:	89 e5                	mov    %esp,%ebp
  800278:	83 ec 08             	sub    $0x8,%esp
    return sys_fork();
  80027b:	e8 b3 fe ff ff       	call   800133 <sys_fork>
}
  800280:	c9                   	leave  
  800281:	c3                   	ret    

00800282 <wait>:

int
wait(void) {
  800282:	f3 0f 1e fb          	endbr32 
  800286:	55                   	push   %ebp
  800287:	89 e5                	mov    %esp,%ebp
  800289:	83 ec 18             	sub    $0x18,%esp
    return sys_wait(0, NULL);
  80028c:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  800293:	00 
  800294:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80029b:	e8 ab fe ff ff       	call   80014b <sys_wait>
}
  8002a0:	c9                   	leave  
  8002a1:	c3                   	ret    

008002a2 <waitpid>:

int
waitpid(int pid, int *store) {
  8002a2:	f3 0f 1e fb          	endbr32 
  8002a6:	55                   	push   %ebp
  8002a7:	89 e5                	mov    %esp,%ebp
  8002a9:	83 ec 18             	sub    $0x18,%esp
    return sys_wait(pid, store);
  8002ac:	8b 45 0c             	mov    0xc(%ebp),%eax
  8002af:	89 44 24 04          	mov    %eax,0x4(%esp)
  8002b3:	8b 45 08             	mov    0x8(%ebp),%eax
  8002b6:	89 04 24             	mov    %eax,(%esp)
  8002b9:	e8 8d fe ff ff       	call   80014b <sys_wait>
}
  8002be:	c9                   	leave  
  8002bf:	c3                   	ret    

008002c0 <yield>:

void
yield(void) {
  8002c0:	f3 0f 1e fb          	endbr32 
  8002c4:	55                   	push   %ebp
  8002c5:	89 e5                	mov    %esp,%ebp
  8002c7:	83 ec 08             	sub    $0x8,%esp
    sys_yield();
  8002ca:	e8 a2 fe ff ff       	call   800171 <sys_yield>
}
  8002cf:	90                   	nop
  8002d0:	c9                   	leave  
  8002d1:	c3                   	ret    

008002d2 <kill>:

int
kill(int pid) {
  8002d2:	f3 0f 1e fb          	endbr32 
  8002d6:	55                   	push   %ebp
  8002d7:	89 e5                	mov    %esp,%ebp
  8002d9:	83 ec 18             	sub    $0x18,%esp
    return sys_kill(pid);
  8002dc:	8b 45 08             	mov    0x8(%ebp),%eax
  8002df:	89 04 24             	mov    %eax,(%esp)
  8002e2:	e8 a2 fe ff ff       	call   800189 <sys_kill>
}
  8002e7:	c9                   	leave  
  8002e8:	c3                   	ret    

008002e9 <getpid>:

int
getpid(void) {
  8002e9:	f3 0f 1e fb          	endbr32 
  8002ed:	55                   	push   %ebp
  8002ee:	89 e5                	mov    %esp,%ebp
  8002f0:	83 ec 08             	sub    $0x8,%esp
    return sys_getpid();
  8002f3:	e8 b0 fe ff ff       	call   8001a8 <sys_getpid>
}
  8002f8:	c9                   	leave  
  8002f9:	c3                   	ret    

008002fa <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
  8002fa:	f3 0f 1e fb          	endbr32 
  8002fe:	55                   	push   %ebp
  8002ff:	89 e5                	mov    %esp,%ebp
  800301:	83 ec 08             	sub    $0x8,%esp
    sys_pgdir();
  800304:	e8 d6 fe ff ff       	call   8001df <sys_pgdir>
}
  800309:	90                   	nop
  80030a:	c9                   	leave  
  80030b:	c3                   	ret    

0080030c <gettime_msec>:

unsigned int
gettime_msec(void) {
  80030c:	f3 0f 1e fb          	endbr32 
  800310:	55                   	push   %ebp
  800311:	89 e5                	mov    %esp,%ebp
  800313:	83 ec 08             	sub    $0x8,%esp
    return (unsigned int)sys_gettime();
  800316:	e8 dc fe ff ff       	call   8001f7 <sys_gettime>
}
  80031b:	c9                   	leave  
  80031c:	c3                   	ret    

0080031d <lab6_set_priority>:

void
lab6_set_priority(uint32_t priority)
{
  80031d:	f3 0f 1e fb          	endbr32 
  800321:	55                   	push   %ebp
  800322:	89 e5                	mov    %esp,%ebp
  800324:	83 ec 18             	sub    $0x18,%esp
    sys_lab6_set_priority(priority);
  800327:	8b 45 08             	mov    0x8(%ebp),%eax
  80032a:	89 04 24             	mov    %eax,(%esp)
  80032d:	e8 dd fe ff ff       	call   80020f <sys_lab6_set_priority>
}
  800332:	90                   	nop
  800333:	c9                   	leave  
  800334:	c3                   	ret    

00800335 <sleep>:

int
sleep(unsigned int time) {
  800335:	f3 0f 1e fb          	endbr32 
  800339:	55                   	push   %ebp
  80033a:	89 e5                	mov    %esp,%ebp
  80033c:	83 ec 18             	sub    $0x18,%esp
    return sys_sleep(time);
  80033f:	8b 45 08             	mov    0x8(%ebp),%eax
  800342:	89 04 24             	mov    %eax,(%esp)
  800345:	e8 e5 fe ff ff       	call   80022f <sys_sleep>
}
  80034a:	c9                   	leave  
  80034b:	c3                   	ret    

0080034c <_start>:
.text
.globl _start
_start:
    # set ebp for backtrace
    movl $0x0, %ebp
  80034c:	bd 00 00 00 00       	mov    $0x0,%ebp

    # move down the esp register
    # since it may cause page fault in backtrace
    subl $0x20, %esp
  800351:	83 ec 20             	sub    $0x20,%esp

    # call user-program function
    call umain
  800354:	e8 db 00 00 00       	call   800434 <umain>
1:  jmp 1b
  800359:	eb fe                	jmp    800359 <_start+0xd>

0080035b <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
  80035b:	f3 0f 1e fb          	endbr32 
  80035f:	55                   	push   %ebp
  800360:	89 e5                	mov    %esp,%ebp
  800362:	83 ec 18             	sub    $0x18,%esp
    sys_putc(c);
  800365:	8b 45 08             	mov    0x8(%ebp),%eax
  800368:	89 04 24             	mov    %eax,(%esp)
  80036b:	e8 50 fe ff ff       	call   8001c0 <sys_putc>
    (*cnt) ++;
  800370:	8b 45 0c             	mov    0xc(%ebp),%eax
  800373:	8b 00                	mov    (%eax),%eax
  800375:	8d 50 01             	lea    0x1(%eax),%edx
  800378:	8b 45 0c             	mov    0xc(%ebp),%eax
  80037b:	89 10                	mov    %edx,(%eax)
}
  80037d:	90                   	nop
  80037e:	c9                   	leave  
  80037f:	c3                   	ret    

00800380 <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
  800380:	f3 0f 1e fb          	endbr32 
  800384:	55                   	push   %ebp
  800385:	89 e5                	mov    %esp,%ebp
  800387:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  80038a:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
  800391:	8b 45 0c             	mov    0xc(%ebp),%eax
  800394:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800398:	8b 45 08             	mov    0x8(%ebp),%eax
  80039b:	89 44 24 08          	mov    %eax,0x8(%esp)
  80039f:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8003a2:	89 44 24 04          	mov    %eax,0x4(%esp)
  8003a6:	c7 04 24 5b 03 80 00 	movl   $0x80035b,(%esp)
  8003ad:	e8 4d 07 00 00       	call   800aff <vprintfmt>
    return cnt;
  8003b2:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  8003b5:	c9                   	leave  
  8003b6:	c3                   	ret    

008003b7 <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
  8003b7:	f3 0f 1e fb          	endbr32 
  8003bb:	55                   	push   %ebp
  8003bc:	89 e5                	mov    %esp,%ebp
  8003be:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
  8003c1:	8d 45 0c             	lea    0xc(%ebp),%eax
  8003c4:	89 45 f0             	mov    %eax,-0x10(%ebp)
    int cnt = vcprintf(fmt, ap);
  8003c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8003ca:	89 44 24 04          	mov    %eax,0x4(%esp)
  8003ce:	8b 45 08             	mov    0x8(%ebp),%eax
  8003d1:	89 04 24             	mov    %eax,(%esp)
  8003d4:	e8 a7 ff ff ff       	call   800380 <vcprintf>
  8003d9:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);

    return cnt;
  8003dc:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  8003df:	c9                   	leave  
  8003e0:	c3                   	ret    

008003e1 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
  8003e1:	f3 0f 1e fb          	endbr32 
  8003e5:	55                   	push   %ebp
  8003e6:	89 e5                	mov    %esp,%ebp
  8003e8:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  8003eb:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
  8003f2:	eb 13                	jmp    800407 <cputs+0x26>
        cputch(c, &cnt);
  8003f4:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  8003f8:	8d 55 f0             	lea    -0x10(%ebp),%edx
  8003fb:	89 54 24 04          	mov    %edx,0x4(%esp)
  8003ff:	89 04 24             	mov    %eax,(%esp)
  800402:	e8 54 ff ff ff       	call   80035b <cputch>
    while ((c = *str ++) != '\0') {
  800407:	8b 45 08             	mov    0x8(%ebp),%eax
  80040a:	8d 50 01             	lea    0x1(%eax),%edx
  80040d:	89 55 08             	mov    %edx,0x8(%ebp)
  800410:	0f b6 00             	movzbl (%eax),%eax
  800413:	88 45 f7             	mov    %al,-0x9(%ebp)
  800416:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
  80041a:	75 d8                	jne    8003f4 <cputs+0x13>
    }
    cputch('\n', &cnt);
  80041c:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80041f:	89 44 24 04          	mov    %eax,0x4(%esp)
  800423:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  80042a:	e8 2c ff ff ff       	call   80035b <cputch>
    return cnt;
  80042f:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  800432:	c9                   	leave  
  800433:	c3                   	ret    

00800434 <umain>:
#include <ulib.h>

int main(void);

void
umain(void) {
  800434:	f3 0f 1e fb          	endbr32 
  800438:	55                   	push   %ebp
  800439:	89 e5                	mov    %esp,%ebp
  80043b:	83 ec 28             	sub    $0x28,%esp
    int ret = main();
  80043e:	e8 7d 0c 00 00       	call   8010c0 <main>
  800443:	89 45 f4             	mov    %eax,-0xc(%ebp)
    exit(ret);
  800446:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800449:	89 04 24             	mov    %eax,(%esp)
  80044c:	e8 fd fd ff ff       	call   80024e <exit>

00800451 <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
  800451:	f3 0f 1e fb          	endbr32 
  800455:	55                   	push   %ebp
  800456:	89 e5                	mov    %esp,%ebp
  800458:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  80045b:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
  800462:	eb 03                	jmp    800467 <strlen+0x16>
        cnt ++;
  800464:	ff 45 fc             	incl   -0x4(%ebp)
    while (*s ++ != '\0') {
  800467:	8b 45 08             	mov    0x8(%ebp),%eax
  80046a:	8d 50 01             	lea    0x1(%eax),%edx
  80046d:	89 55 08             	mov    %edx,0x8(%ebp)
  800470:	0f b6 00             	movzbl (%eax),%eax
  800473:	84 c0                	test   %al,%al
  800475:	75 ed                	jne    800464 <strlen+0x13>
    }
    return cnt;
  800477:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  80047a:	c9                   	leave  
  80047b:	c3                   	ret    

0080047c <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
  80047c:	f3 0f 1e fb          	endbr32 
  800480:	55                   	push   %ebp
  800481:	89 e5                	mov    %esp,%ebp
  800483:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  800486:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
  80048d:	eb 03                	jmp    800492 <strnlen+0x16>
        cnt ++;
  80048f:	ff 45 fc             	incl   -0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
  800492:	8b 45 fc             	mov    -0x4(%ebp),%eax
  800495:	3b 45 0c             	cmp    0xc(%ebp),%eax
  800498:	73 10                	jae    8004aa <strnlen+0x2e>
  80049a:	8b 45 08             	mov    0x8(%ebp),%eax
  80049d:	8d 50 01             	lea    0x1(%eax),%edx
  8004a0:	89 55 08             	mov    %edx,0x8(%ebp)
  8004a3:	0f b6 00             	movzbl (%eax),%eax
  8004a6:	84 c0                	test   %al,%al
  8004a8:	75 e5                	jne    80048f <strnlen+0x13>
    }
    return cnt;
  8004aa:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  8004ad:	c9                   	leave  
  8004ae:	c3                   	ret    

008004af <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
  8004af:	f3 0f 1e fb          	endbr32 
  8004b3:	55                   	push   %ebp
  8004b4:	89 e5                	mov    %esp,%ebp
  8004b6:	57                   	push   %edi
  8004b7:	56                   	push   %esi
  8004b8:	83 ec 20             	sub    $0x20,%esp
  8004bb:	8b 45 08             	mov    0x8(%ebp),%eax
  8004be:	89 45 f4             	mov    %eax,-0xc(%ebp)
  8004c1:	8b 45 0c             	mov    0xc(%ebp),%eax
  8004c4:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
  8004c7:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8004ca:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8004cd:	89 d1                	mov    %edx,%ecx
  8004cf:	89 c2                	mov    %eax,%edx
  8004d1:	89 ce                	mov    %ecx,%esi
  8004d3:	89 d7                	mov    %edx,%edi
  8004d5:	ac                   	lods   %ds:(%esi),%al
  8004d6:	aa                   	stos   %al,%es:(%edi)
  8004d7:	84 c0                	test   %al,%al
  8004d9:	75 fa                	jne    8004d5 <strcpy+0x26>
  8004db:	89 fa                	mov    %edi,%edx
  8004dd:	89 f1                	mov    %esi,%ecx
  8004df:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  8004e2:	89 55 e8             	mov    %edx,-0x18(%ebp)
  8004e5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
  8004e8:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
  8004eb:	83 c4 20             	add    $0x20,%esp
  8004ee:	5e                   	pop    %esi
  8004ef:	5f                   	pop    %edi
  8004f0:	5d                   	pop    %ebp
  8004f1:	c3                   	ret    

008004f2 <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
  8004f2:	f3 0f 1e fb          	endbr32 
  8004f6:	55                   	push   %ebp
  8004f7:	89 e5                	mov    %esp,%ebp
  8004f9:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
  8004fc:	8b 45 08             	mov    0x8(%ebp),%eax
  8004ff:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
  800502:	eb 1e                	jmp    800522 <strncpy+0x30>
        if ((*p = *src) != '\0') {
  800504:	8b 45 0c             	mov    0xc(%ebp),%eax
  800507:	0f b6 10             	movzbl (%eax),%edx
  80050a:	8b 45 fc             	mov    -0x4(%ebp),%eax
  80050d:	88 10                	mov    %dl,(%eax)
  80050f:	8b 45 fc             	mov    -0x4(%ebp),%eax
  800512:	0f b6 00             	movzbl (%eax),%eax
  800515:	84 c0                	test   %al,%al
  800517:	74 03                	je     80051c <strncpy+0x2a>
            src ++;
  800519:	ff 45 0c             	incl   0xc(%ebp)
        }
        p ++, len --;
  80051c:	ff 45 fc             	incl   -0x4(%ebp)
  80051f:	ff 4d 10             	decl   0x10(%ebp)
    while (len > 0) {
  800522:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  800526:	75 dc                	jne    800504 <strncpy+0x12>
    }
    return dst;
  800528:	8b 45 08             	mov    0x8(%ebp),%eax
}
  80052b:	c9                   	leave  
  80052c:	c3                   	ret    

0080052d <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
  80052d:	f3 0f 1e fb          	endbr32 
  800531:	55                   	push   %ebp
  800532:	89 e5                	mov    %esp,%ebp
  800534:	57                   	push   %edi
  800535:	56                   	push   %esi
  800536:	83 ec 20             	sub    $0x20,%esp
  800539:	8b 45 08             	mov    0x8(%ebp),%eax
  80053c:	89 45 f4             	mov    %eax,-0xc(%ebp)
  80053f:	8b 45 0c             	mov    0xc(%ebp),%eax
  800542:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile (
  800545:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800548:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80054b:	89 d1                	mov    %edx,%ecx
  80054d:	89 c2                	mov    %eax,%edx
  80054f:	89 ce                	mov    %ecx,%esi
  800551:	89 d7                	mov    %edx,%edi
  800553:	ac                   	lods   %ds:(%esi),%al
  800554:	ae                   	scas   %es:(%edi),%al
  800555:	75 08                	jne    80055f <strcmp+0x32>
  800557:	84 c0                	test   %al,%al
  800559:	75 f8                	jne    800553 <strcmp+0x26>
  80055b:	31 c0                	xor    %eax,%eax
  80055d:	eb 04                	jmp    800563 <strcmp+0x36>
  80055f:	19 c0                	sbb    %eax,%eax
  800561:	0c 01                	or     $0x1,%al
  800563:	89 fa                	mov    %edi,%edx
  800565:	89 f1                	mov    %esi,%ecx
  800567:	89 45 ec             	mov    %eax,-0x14(%ebp)
  80056a:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  80056d:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return ret;
  800570:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
  800573:	83 c4 20             	add    $0x20,%esp
  800576:	5e                   	pop    %esi
  800577:	5f                   	pop    %edi
  800578:	5d                   	pop    %ebp
  800579:	c3                   	ret    

0080057a <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
  80057a:	f3 0f 1e fb          	endbr32 
  80057e:	55                   	push   %ebp
  80057f:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  800581:	eb 09                	jmp    80058c <strncmp+0x12>
        n --, s1 ++, s2 ++;
  800583:	ff 4d 10             	decl   0x10(%ebp)
  800586:	ff 45 08             	incl   0x8(%ebp)
  800589:	ff 45 0c             	incl   0xc(%ebp)
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  80058c:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  800590:	74 1a                	je     8005ac <strncmp+0x32>
  800592:	8b 45 08             	mov    0x8(%ebp),%eax
  800595:	0f b6 00             	movzbl (%eax),%eax
  800598:	84 c0                	test   %al,%al
  80059a:	74 10                	je     8005ac <strncmp+0x32>
  80059c:	8b 45 08             	mov    0x8(%ebp),%eax
  80059f:	0f b6 10             	movzbl (%eax),%edx
  8005a2:	8b 45 0c             	mov    0xc(%ebp),%eax
  8005a5:	0f b6 00             	movzbl (%eax),%eax
  8005a8:	38 c2                	cmp    %al,%dl
  8005aa:	74 d7                	je     800583 <strncmp+0x9>
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
  8005ac:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8005b0:	74 18                	je     8005ca <strncmp+0x50>
  8005b2:	8b 45 08             	mov    0x8(%ebp),%eax
  8005b5:	0f b6 00             	movzbl (%eax),%eax
  8005b8:	0f b6 d0             	movzbl %al,%edx
  8005bb:	8b 45 0c             	mov    0xc(%ebp),%eax
  8005be:	0f b6 00             	movzbl (%eax),%eax
  8005c1:	0f b6 c0             	movzbl %al,%eax
  8005c4:	29 c2                	sub    %eax,%edx
  8005c6:	89 d0                	mov    %edx,%eax
  8005c8:	eb 05                	jmp    8005cf <strncmp+0x55>
  8005ca:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8005cf:	5d                   	pop    %ebp
  8005d0:	c3                   	ret    

008005d1 <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
  8005d1:	f3 0f 1e fb          	endbr32 
  8005d5:	55                   	push   %ebp
  8005d6:	89 e5                	mov    %esp,%ebp
  8005d8:	83 ec 04             	sub    $0x4,%esp
  8005db:	8b 45 0c             	mov    0xc(%ebp),%eax
  8005de:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  8005e1:	eb 13                	jmp    8005f6 <strchr+0x25>
        if (*s == c) {
  8005e3:	8b 45 08             	mov    0x8(%ebp),%eax
  8005e6:	0f b6 00             	movzbl (%eax),%eax
  8005e9:	38 45 fc             	cmp    %al,-0x4(%ebp)
  8005ec:	75 05                	jne    8005f3 <strchr+0x22>
            return (char *)s;
  8005ee:	8b 45 08             	mov    0x8(%ebp),%eax
  8005f1:	eb 12                	jmp    800605 <strchr+0x34>
        }
        s ++;
  8005f3:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
  8005f6:	8b 45 08             	mov    0x8(%ebp),%eax
  8005f9:	0f b6 00             	movzbl (%eax),%eax
  8005fc:	84 c0                	test   %al,%al
  8005fe:	75 e3                	jne    8005e3 <strchr+0x12>
    }
    return NULL;
  800600:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800605:	c9                   	leave  
  800606:	c3                   	ret    

00800607 <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
  800607:	f3 0f 1e fb          	endbr32 
  80060b:	55                   	push   %ebp
  80060c:	89 e5                	mov    %esp,%ebp
  80060e:	83 ec 04             	sub    $0x4,%esp
  800611:	8b 45 0c             	mov    0xc(%ebp),%eax
  800614:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  800617:	eb 0e                	jmp    800627 <strfind+0x20>
        if (*s == c) {
  800619:	8b 45 08             	mov    0x8(%ebp),%eax
  80061c:	0f b6 00             	movzbl (%eax),%eax
  80061f:	38 45 fc             	cmp    %al,-0x4(%ebp)
  800622:	74 0f                	je     800633 <strfind+0x2c>
            break;
        }
        s ++;
  800624:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
  800627:	8b 45 08             	mov    0x8(%ebp),%eax
  80062a:	0f b6 00             	movzbl (%eax),%eax
  80062d:	84 c0                	test   %al,%al
  80062f:	75 e8                	jne    800619 <strfind+0x12>
  800631:	eb 01                	jmp    800634 <strfind+0x2d>
            break;
  800633:	90                   	nop
    }
    return (char *)s;
  800634:	8b 45 08             	mov    0x8(%ebp),%eax
}
  800637:	c9                   	leave  
  800638:	c3                   	ret    

00800639 <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
  800639:	f3 0f 1e fb          	endbr32 
  80063d:	55                   	push   %ebp
  80063e:	89 e5                	mov    %esp,%ebp
  800640:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
  800643:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
  80064a:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
  800651:	eb 03                	jmp    800656 <strtol+0x1d>
        s ++;
  800653:	ff 45 08             	incl   0x8(%ebp)
    while (*s == ' ' || *s == '\t') {
  800656:	8b 45 08             	mov    0x8(%ebp),%eax
  800659:	0f b6 00             	movzbl (%eax),%eax
  80065c:	3c 20                	cmp    $0x20,%al
  80065e:	74 f3                	je     800653 <strtol+0x1a>
  800660:	8b 45 08             	mov    0x8(%ebp),%eax
  800663:	0f b6 00             	movzbl (%eax),%eax
  800666:	3c 09                	cmp    $0x9,%al
  800668:	74 e9                	je     800653 <strtol+0x1a>
    }

    // plus/minus sign
    if (*s == '+') {
  80066a:	8b 45 08             	mov    0x8(%ebp),%eax
  80066d:	0f b6 00             	movzbl (%eax),%eax
  800670:	3c 2b                	cmp    $0x2b,%al
  800672:	75 05                	jne    800679 <strtol+0x40>
        s ++;
  800674:	ff 45 08             	incl   0x8(%ebp)
  800677:	eb 14                	jmp    80068d <strtol+0x54>
    }
    else if (*s == '-') {
  800679:	8b 45 08             	mov    0x8(%ebp),%eax
  80067c:	0f b6 00             	movzbl (%eax),%eax
  80067f:	3c 2d                	cmp    $0x2d,%al
  800681:	75 0a                	jne    80068d <strtol+0x54>
        s ++, neg = 1;
  800683:	ff 45 08             	incl   0x8(%ebp)
  800686:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
  80068d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  800691:	74 06                	je     800699 <strtol+0x60>
  800693:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
  800697:	75 22                	jne    8006bb <strtol+0x82>
  800699:	8b 45 08             	mov    0x8(%ebp),%eax
  80069c:	0f b6 00             	movzbl (%eax),%eax
  80069f:	3c 30                	cmp    $0x30,%al
  8006a1:	75 18                	jne    8006bb <strtol+0x82>
  8006a3:	8b 45 08             	mov    0x8(%ebp),%eax
  8006a6:	40                   	inc    %eax
  8006a7:	0f b6 00             	movzbl (%eax),%eax
  8006aa:	3c 78                	cmp    $0x78,%al
  8006ac:	75 0d                	jne    8006bb <strtol+0x82>
        s += 2, base = 16;
  8006ae:	83 45 08 02          	addl   $0x2,0x8(%ebp)
  8006b2:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
  8006b9:	eb 29                	jmp    8006e4 <strtol+0xab>
    }
    else if (base == 0 && s[0] == '0') {
  8006bb:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8006bf:	75 16                	jne    8006d7 <strtol+0x9e>
  8006c1:	8b 45 08             	mov    0x8(%ebp),%eax
  8006c4:	0f b6 00             	movzbl (%eax),%eax
  8006c7:	3c 30                	cmp    $0x30,%al
  8006c9:	75 0c                	jne    8006d7 <strtol+0x9e>
        s ++, base = 8;
  8006cb:	ff 45 08             	incl   0x8(%ebp)
  8006ce:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
  8006d5:	eb 0d                	jmp    8006e4 <strtol+0xab>
    }
    else if (base == 0) {
  8006d7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8006db:	75 07                	jne    8006e4 <strtol+0xab>
        base = 10;
  8006dd:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
  8006e4:	8b 45 08             	mov    0x8(%ebp),%eax
  8006e7:	0f b6 00             	movzbl (%eax),%eax
  8006ea:	3c 2f                	cmp    $0x2f,%al
  8006ec:	7e 1b                	jle    800709 <strtol+0xd0>
  8006ee:	8b 45 08             	mov    0x8(%ebp),%eax
  8006f1:	0f b6 00             	movzbl (%eax),%eax
  8006f4:	3c 39                	cmp    $0x39,%al
  8006f6:	7f 11                	jg     800709 <strtol+0xd0>
            dig = *s - '0';
  8006f8:	8b 45 08             	mov    0x8(%ebp),%eax
  8006fb:	0f b6 00             	movzbl (%eax),%eax
  8006fe:	0f be c0             	movsbl %al,%eax
  800701:	83 e8 30             	sub    $0x30,%eax
  800704:	89 45 f4             	mov    %eax,-0xc(%ebp)
  800707:	eb 48                	jmp    800751 <strtol+0x118>
        }
        else if (*s >= 'a' && *s <= 'z') {
  800709:	8b 45 08             	mov    0x8(%ebp),%eax
  80070c:	0f b6 00             	movzbl (%eax),%eax
  80070f:	3c 60                	cmp    $0x60,%al
  800711:	7e 1b                	jle    80072e <strtol+0xf5>
  800713:	8b 45 08             	mov    0x8(%ebp),%eax
  800716:	0f b6 00             	movzbl (%eax),%eax
  800719:	3c 7a                	cmp    $0x7a,%al
  80071b:	7f 11                	jg     80072e <strtol+0xf5>
            dig = *s - 'a' + 10;
  80071d:	8b 45 08             	mov    0x8(%ebp),%eax
  800720:	0f b6 00             	movzbl (%eax),%eax
  800723:	0f be c0             	movsbl %al,%eax
  800726:	83 e8 57             	sub    $0x57,%eax
  800729:	89 45 f4             	mov    %eax,-0xc(%ebp)
  80072c:	eb 23                	jmp    800751 <strtol+0x118>
        }
        else if (*s >= 'A' && *s <= 'Z') {
  80072e:	8b 45 08             	mov    0x8(%ebp),%eax
  800731:	0f b6 00             	movzbl (%eax),%eax
  800734:	3c 40                	cmp    $0x40,%al
  800736:	7e 3b                	jle    800773 <strtol+0x13a>
  800738:	8b 45 08             	mov    0x8(%ebp),%eax
  80073b:	0f b6 00             	movzbl (%eax),%eax
  80073e:	3c 5a                	cmp    $0x5a,%al
  800740:	7f 31                	jg     800773 <strtol+0x13a>
            dig = *s - 'A' + 10;
  800742:	8b 45 08             	mov    0x8(%ebp),%eax
  800745:	0f b6 00             	movzbl (%eax),%eax
  800748:	0f be c0             	movsbl %al,%eax
  80074b:	83 e8 37             	sub    $0x37,%eax
  80074e:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
  800751:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800754:	3b 45 10             	cmp    0x10(%ebp),%eax
  800757:	7d 19                	jge    800772 <strtol+0x139>
            break;
        }
        s ++, val = (val * base) + dig;
  800759:	ff 45 08             	incl   0x8(%ebp)
  80075c:	8b 45 f8             	mov    -0x8(%ebp),%eax
  80075f:	0f af 45 10          	imul   0x10(%ebp),%eax
  800763:	89 c2                	mov    %eax,%edx
  800765:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800768:	01 d0                	add    %edx,%eax
  80076a:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (1) {
  80076d:	e9 72 ff ff ff       	jmp    8006e4 <strtol+0xab>
            break;
  800772:	90                   	nop
        // we don't properly detect overflow!
    }

    if (endptr) {
  800773:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800777:	74 08                	je     800781 <strtol+0x148>
        *endptr = (char *) s;
  800779:	8b 45 0c             	mov    0xc(%ebp),%eax
  80077c:	8b 55 08             	mov    0x8(%ebp),%edx
  80077f:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
  800781:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
  800785:	74 07                	je     80078e <strtol+0x155>
  800787:	8b 45 f8             	mov    -0x8(%ebp),%eax
  80078a:	f7 d8                	neg    %eax
  80078c:	eb 03                	jmp    800791 <strtol+0x158>
  80078e:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
  800791:	c9                   	leave  
  800792:	c3                   	ret    

00800793 <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
  800793:	f3 0f 1e fb          	endbr32 
  800797:	55                   	push   %ebp
  800798:	89 e5                	mov    %esp,%ebp
  80079a:	57                   	push   %edi
  80079b:	83 ec 24             	sub    $0x24,%esp
  80079e:	8b 45 0c             	mov    0xc(%ebp),%eax
  8007a1:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
  8007a4:	0f be 55 d8          	movsbl -0x28(%ebp),%edx
  8007a8:	8b 45 08             	mov    0x8(%ebp),%eax
  8007ab:	89 45 f8             	mov    %eax,-0x8(%ebp)
  8007ae:	88 55 f7             	mov    %dl,-0x9(%ebp)
  8007b1:	8b 45 10             	mov    0x10(%ebp),%eax
  8007b4:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
  8007b7:	8b 4d f0             	mov    -0x10(%ebp),%ecx
  8007ba:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
  8007be:	8b 55 f8             	mov    -0x8(%ebp),%edx
  8007c1:	89 d7                	mov    %edx,%edi
  8007c3:	f3 aa                	rep stos %al,%es:(%edi)
  8007c5:	89 fa                	mov    %edi,%edx
  8007c7:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  8007ca:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
  8007cd:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
  8007d0:	83 c4 24             	add    $0x24,%esp
  8007d3:	5f                   	pop    %edi
  8007d4:	5d                   	pop    %ebp
  8007d5:	c3                   	ret    

008007d6 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
  8007d6:	f3 0f 1e fb          	endbr32 
  8007da:	55                   	push   %ebp
  8007db:	89 e5                	mov    %esp,%ebp
  8007dd:	57                   	push   %edi
  8007de:	56                   	push   %esi
  8007df:	53                   	push   %ebx
  8007e0:	83 ec 30             	sub    $0x30,%esp
  8007e3:	8b 45 08             	mov    0x8(%ebp),%eax
  8007e6:	89 45 f0             	mov    %eax,-0x10(%ebp)
  8007e9:	8b 45 0c             	mov    0xc(%ebp),%eax
  8007ec:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8007ef:	8b 45 10             	mov    0x10(%ebp),%eax
  8007f2:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
  8007f5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8007f8:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  8007fb:	73 42                	jae    80083f <memmove+0x69>
  8007fd:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800800:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800803:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800806:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800809:	8b 45 e8             	mov    -0x18(%ebp),%eax
  80080c:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  80080f:	8b 45 dc             	mov    -0x24(%ebp),%eax
  800812:	c1 e8 02             	shr    $0x2,%eax
  800815:	89 c1                	mov    %eax,%ecx
    asm volatile (
  800817:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80081a:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80081d:	89 d7                	mov    %edx,%edi
  80081f:	89 c6                	mov    %eax,%esi
  800821:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800823:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800826:	83 e1 03             	and    $0x3,%ecx
  800829:	74 02                	je     80082d <memmove+0x57>
  80082b:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  80082d:	89 f0                	mov    %esi,%eax
  80082f:	89 fa                	mov    %edi,%edx
  800831:	89 4d d8             	mov    %ecx,-0x28(%ebp)
  800834:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800837:	89 45 d0             	mov    %eax,-0x30(%ebp)
        : "memory");
    return dst;
  80083a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
        return __memcpy(dst, src, n);
  80083d:	eb 36                	jmp    800875 <memmove+0x9f>
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
  80083f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  800842:	8d 50 ff             	lea    -0x1(%eax),%edx
  800845:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800848:	01 c2                	add    %eax,%edx
  80084a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  80084d:	8d 48 ff             	lea    -0x1(%eax),%ecx
  800850:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800853:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
    asm volatile (
  800856:	8b 45 e8             	mov    -0x18(%ebp),%eax
  800859:	89 c1                	mov    %eax,%ecx
  80085b:	89 d8                	mov    %ebx,%eax
  80085d:	89 d6                	mov    %edx,%esi
  80085f:	89 c7                	mov    %eax,%edi
  800861:	fd                   	std    
  800862:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  800864:	fc                   	cld    
  800865:	89 f8                	mov    %edi,%eax
  800867:	89 f2                	mov    %esi,%edx
  800869:	89 4d cc             	mov    %ecx,-0x34(%ebp)
  80086c:	89 55 c8             	mov    %edx,-0x38(%ebp)
  80086f:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return dst;
  800872:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
  800875:	83 c4 30             	add    $0x30,%esp
  800878:	5b                   	pop    %ebx
  800879:	5e                   	pop    %esi
  80087a:	5f                   	pop    %edi
  80087b:	5d                   	pop    %ebp
  80087c:	c3                   	ret    

0080087d <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
  80087d:	f3 0f 1e fb          	endbr32 
  800881:	55                   	push   %ebp
  800882:	89 e5                	mov    %esp,%ebp
  800884:	57                   	push   %edi
  800885:	56                   	push   %esi
  800886:	83 ec 20             	sub    $0x20,%esp
  800889:	8b 45 08             	mov    0x8(%ebp),%eax
  80088c:	89 45 f4             	mov    %eax,-0xc(%ebp)
  80088f:	8b 45 0c             	mov    0xc(%ebp),%eax
  800892:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800895:	8b 45 10             	mov    0x10(%ebp),%eax
  800898:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  80089b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  80089e:	c1 e8 02             	shr    $0x2,%eax
  8008a1:	89 c1                	mov    %eax,%ecx
    asm volatile (
  8008a3:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8008a6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8008a9:	89 d7                	mov    %edx,%edi
  8008ab:	89 c6                	mov    %eax,%esi
  8008ad:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  8008af:	8b 4d ec             	mov    -0x14(%ebp),%ecx
  8008b2:	83 e1 03             	and    $0x3,%ecx
  8008b5:	74 02                	je     8008b9 <memcpy+0x3c>
  8008b7:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  8008b9:	89 f0                	mov    %esi,%eax
  8008bb:	89 fa                	mov    %edi,%edx
  8008bd:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  8008c0:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  8008c3:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return dst;
  8008c6:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
  8008c9:	83 c4 20             	add    $0x20,%esp
  8008cc:	5e                   	pop    %esi
  8008cd:	5f                   	pop    %edi
  8008ce:	5d                   	pop    %ebp
  8008cf:	c3                   	ret    

008008d0 <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
  8008d0:	f3 0f 1e fb          	endbr32 
  8008d4:	55                   	push   %ebp
  8008d5:	89 e5                	mov    %esp,%ebp
  8008d7:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
  8008da:	8b 45 08             	mov    0x8(%ebp),%eax
  8008dd:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
  8008e0:	8b 45 0c             	mov    0xc(%ebp),%eax
  8008e3:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
  8008e6:	eb 2e                	jmp    800916 <memcmp+0x46>
        if (*s1 != *s2) {
  8008e8:	8b 45 fc             	mov    -0x4(%ebp),%eax
  8008eb:	0f b6 10             	movzbl (%eax),%edx
  8008ee:	8b 45 f8             	mov    -0x8(%ebp),%eax
  8008f1:	0f b6 00             	movzbl (%eax),%eax
  8008f4:	38 c2                	cmp    %al,%dl
  8008f6:	74 18                	je     800910 <memcmp+0x40>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
  8008f8:	8b 45 fc             	mov    -0x4(%ebp),%eax
  8008fb:	0f b6 00             	movzbl (%eax),%eax
  8008fe:	0f b6 d0             	movzbl %al,%edx
  800901:	8b 45 f8             	mov    -0x8(%ebp),%eax
  800904:	0f b6 00             	movzbl (%eax),%eax
  800907:	0f b6 c0             	movzbl %al,%eax
  80090a:	29 c2                	sub    %eax,%edx
  80090c:	89 d0                	mov    %edx,%eax
  80090e:	eb 18                	jmp    800928 <memcmp+0x58>
        }
        s1 ++, s2 ++;
  800910:	ff 45 fc             	incl   -0x4(%ebp)
  800913:	ff 45 f8             	incl   -0x8(%ebp)
    while (n -- > 0) {
  800916:	8b 45 10             	mov    0x10(%ebp),%eax
  800919:	8d 50 ff             	lea    -0x1(%eax),%edx
  80091c:	89 55 10             	mov    %edx,0x10(%ebp)
  80091f:	85 c0                	test   %eax,%eax
  800921:	75 c5                	jne    8008e8 <memcmp+0x18>
    }
    return 0;
  800923:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800928:	c9                   	leave  
  800929:	c3                   	ret    

0080092a <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
  80092a:	f3 0f 1e fb          	endbr32 
  80092e:	55                   	push   %ebp
  80092f:	89 e5                	mov    %esp,%ebp
  800931:	83 ec 58             	sub    $0x58,%esp
  800934:	8b 45 10             	mov    0x10(%ebp),%eax
  800937:	89 45 d0             	mov    %eax,-0x30(%ebp)
  80093a:	8b 45 14             	mov    0x14(%ebp),%eax
  80093d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
  800940:	8b 45 d0             	mov    -0x30(%ebp),%eax
  800943:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800946:	89 45 e8             	mov    %eax,-0x18(%ebp)
  800949:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
  80094c:	8b 45 18             	mov    0x18(%ebp),%eax
  80094f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800952:	8b 45 e8             	mov    -0x18(%ebp),%eax
  800955:	8b 55 ec             	mov    -0x14(%ebp),%edx
  800958:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80095b:	89 55 f0             	mov    %edx,-0x10(%ebp)
  80095e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800961:	89 45 f4             	mov    %eax,-0xc(%ebp)
  800964:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  800968:	74 1c                	je     800986 <printnum+0x5c>
  80096a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80096d:	ba 00 00 00 00       	mov    $0x0,%edx
  800972:	f7 75 e4             	divl   -0x1c(%ebp)
  800975:	89 55 f4             	mov    %edx,-0xc(%ebp)
  800978:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80097b:	ba 00 00 00 00       	mov    $0x0,%edx
  800980:	f7 75 e4             	divl   -0x1c(%ebp)
  800983:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800986:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800989:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80098c:	f7 75 e4             	divl   -0x1c(%ebp)
  80098f:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800992:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800995:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800998:	8b 55 f0             	mov    -0x10(%ebp),%edx
  80099b:	89 45 e8             	mov    %eax,-0x18(%ebp)
  80099e:	89 55 ec             	mov    %edx,-0x14(%ebp)
  8009a1:	8b 45 dc             	mov    -0x24(%ebp),%eax
  8009a4:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
  8009a7:	8b 45 18             	mov    0x18(%ebp),%eax
  8009aa:	ba 00 00 00 00       	mov    $0x0,%edx
  8009af:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  8009b2:	39 45 d0             	cmp    %eax,-0x30(%ebp)
  8009b5:	19 d1                	sbb    %edx,%ecx
  8009b7:	72 4c                	jb     800a05 <printnum+0xdb>
        printnum(putch, putdat, result, base, width - 1, padc);
  8009b9:	8b 45 1c             	mov    0x1c(%ebp),%eax
  8009bc:	8d 50 ff             	lea    -0x1(%eax),%edx
  8009bf:	8b 45 20             	mov    0x20(%ebp),%eax
  8009c2:	89 44 24 18          	mov    %eax,0x18(%esp)
  8009c6:	89 54 24 14          	mov    %edx,0x14(%esp)
  8009ca:	8b 45 18             	mov    0x18(%ebp),%eax
  8009cd:	89 44 24 10          	mov    %eax,0x10(%esp)
  8009d1:	8b 45 e8             	mov    -0x18(%ebp),%eax
  8009d4:	8b 55 ec             	mov    -0x14(%ebp),%edx
  8009d7:	89 44 24 08          	mov    %eax,0x8(%esp)
  8009db:	89 54 24 0c          	mov    %edx,0xc(%esp)
  8009df:	8b 45 0c             	mov    0xc(%ebp),%eax
  8009e2:	89 44 24 04          	mov    %eax,0x4(%esp)
  8009e6:	8b 45 08             	mov    0x8(%ebp),%eax
  8009e9:	89 04 24             	mov    %eax,(%esp)
  8009ec:	e8 39 ff ff ff       	call   80092a <printnum>
  8009f1:	eb 1b                	jmp    800a0e <printnum+0xe4>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
  8009f3:	8b 45 0c             	mov    0xc(%ebp),%eax
  8009f6:	89 44 24 04          	mov    %eax,0x4(%esp)
  8009fa:	8b 45 20             	mov    0x20(%ebp),%eax
  8009fd:	89 04 24             	mov    %eax,(%esp)
  800a00:	8b 45 08             	mov    0x8(%ebp),%eax
  800a03:	ff d0                	call   *%eax
        while (-- width > 0)
  800a05:	ff 4d 1c             	decl   0x1c(%ebp)
  800a08:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  800a0c:	7f e5                	jg     8009f3 <printnum+0xc9>
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
  800a0e:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800a11:	05 84 13 80 00       	add    $0x801384,%eax
  800a16:	0f b6 00             	movzbl (%eax),%eax
  800a19:	0f be c0             	movsbl %al,%eax
  800a1c:	8b 55 0c             	mov    0xc(%ebp),%edx
  800a1f:	89 54 24 04          	mov    %edx,0x4(%esp)
  800a23:	89 04 24             	mov    %eax,(%esp)
  800a26:	8b 45 08             	mov    0x8(%ebp),%eax
  800a29:	ff d0                	call   *%eax
}
  800a2b:	90                   	nop
  800a2c:	c9                   	leave  
  800a2d:	c3                   	ret    

00800a2e <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
  800a2e:	f3 0f 1e fb          	endbr32 
  800a32:	55                   	push   %ebp
  800a33:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  800a35:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  800a39:	7e 14                	jle    800a4f <getuint+0x21>
        return va_arg(*ap, unsigned long long);
  800a3b:	8b 45 08             	mov    0x8(%ebp),%eax
  800a3e:	8b 00                	mov    (%eax),%eax
  800a40:	8d 48 08             	lea    0x8(%eax),%ecx
  800a43:	8b 55 08             	mov    0x8(%ebp),%edx
  800a46:	89 0a                	mov    %ecx,(%edx)
  800a48:	8b 50 04             	mov    0x4(%eax),%edx
  800a4b:	8b 00                	mov    (%eax),%eax
  800a4d:	eb 30                	jmp    800a7f <getuint+0x51>
    }
    else if (lflag) {
  800a4f:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800a53:	74 16                	je     800a6b <getuint+0x3d>
        return va_arg(*ap, unsigned long);
  800a55:	8b 45 08             	mov    0x8(%ebp),%eax
  800a58:	8b 00                	mov    (%eax),%eax
  800a5a:	8d 48 04             	lea    0x4(%eax),%ecx
  800a5d:	8b 55 08             	mov    0x8(%ebp),%edx
  800a60:	89 0a                	mov    %ecx,(%edx)
  800a62:	8b 00                	mov    (%eax),%eax
  800a64:	ba 00 00 00 00       	mov    $0x0,%edx
  800a69:	eb 14                	jmp    800a7f <getuint+0x51>
    }
    else {
        return va_arg(*ap, unsigned int);
  800a6b:	8b 45 08             	mov    0x8(%ebp),%eax
  800a6e:	8b 00                	mov    (%eax),%eax
  800a70:	8d 48 04             	lea    0x4(%eax),%ecx
  800a73:	8b 55 08             	mov    0x8(%ebp),%edx
  800a76:	89 0a                	mov    %ecx,(%edx)
  800a78:	8b 00                	mov    (%eax),%eax
  800a7a:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
  800a7f:	5d                   	pop    %ebp
  800a80:	c3                   	ret    

00800a81 <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
  800a81:	f3 0f 1e fb          	endbr32 
  800a85:	55                   	push   %ebp
  800a86:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  800a88:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  800a8c:	7e 14                	jle    800aa2 <getint+0x21>
        return va_arg(*ap, long long);
  800a8e:	8b 45 08             	mov    0x8(%ebp),%eax
  800a91:	8b 00                	mov    (%eax),%eax
  800a93:	8d 48 08             	lea    0x8(%eax),%ecx
  800a96:	8b 55 08             	mov    0x8(%ebp),%edx
  800a99:	89 0a                	mov    %ecx,(%edx)
  800a9b:	8b 50 04             	mov    0x4(%eax),%edx
  800a9e:	8b 00                	mov    (%eax),%eax
  800aa0:	eb 28                	jmp    800aca <getint+0x49>
    }
    else if (lflag) {
  800aa2:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800aa6:	74 12                	je     800aba <getint+0x39>
        return va_arg(*ap, long);
  800aa8:	8b 45 08             	mov    0x8(%ebp),%eax
  800aab:	8b 00                	mov    (%eax),%eax
  800aad:	8d 48 04             	lea    0x4(%eax),%ecx
  800ab0:	8b 55 08             	mov    0x8(%ebp),%edx
  800ab3:	89 0a                	mov    %ecx,(%edx)
  800ab5:	8b 00                	mov    (%eax),%eax
  800ab7:	99                   	cltd   
  800ab8:	eb 10                	jmp    800aca <getint+0x49>
    }
    else {
        return va_arg(*ap, int);
  800aba:	8b 45 08             	mov    0x8(%ebp),%eax
  800abd:	8b 00                	mov    (%eax),%eax
  800abf:	8d 48 04             	lea    0x4(%eax),%ecx
  800ac2:	8b 55 08             	mov    0x8(%ebp),%edx
  800ac5:	89 0a                	mov    %ecx,(%edx)
  800ac7:	8b 00                	mov    (%eax),%eax
  800ac9:	99                   	cltd   
    }
}
  800aca:	5d                   	pop    %ebp
  800acb:	c3                   	ret    

00800acc <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
  800acc:	f3 0f 1e fb          	endbr32 
  800ad0:	55                   	push   %ebp
  800ad1:	89 e5                	mov    %esp,%ebp
  800ad3:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
  800ad6:	8d 45 14             	lea    0x14(%ebp),%eax
  800ad9:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
  800adc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800adf:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800ae3:	8b 45 10             	mov    0x10(%ebp),%eax
  800ae6:	89 44 24 08          	mov    %eax,0x8(%esp)
  800aea:	8b 45 0c             	mov    0xc(%ebp),%eax
  800aed:	89 44 24 04          	mov    %eax,0x4(%esp)
  800af1:	8b 45 08             	mov    0x8(%ebp),%eax
  800af4:	89 04 24             	mov    %eax,(%esp)
  800af7:	e8 03 00 00 00       	call   800aff <vprintfmt>
    va_end(ap);
}
  800afc:	90                   	nop
  800afd:	c9                   	leave  
  800afe:	c3                   	ret    

00800aff <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
  800aff:	f3 0f 1e fb          	endbr32 
  800b03:	55                   	push   %ebp
  800b04:	89 e5                	mov    %esp,%ebp
  800b06:	56                   	push   %esi
  800b07:	53                   	push   %ebx
  800b08:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  800b0b:	eb 17                	jmp    800b24 <vprintfmt+0x25>
            if (ch == '\0') {
  800b0d:	85 db                	test   %ebx,%ebx
  800b0f:	0f 84 c0 03 00 00    	je     800ed5 <vprintfmt+0x3d6>
                return;
            }
            putch(ch, putdat);
  800b15:	8b 45 0c             	mov    0xc(%ebp),%eax
  800b18:	89 44 24 04          	mov    %eax,0x4(%esp)
  800b1c:	89 1c 24             	mov    %ebx,(%esp)
  800b1f:	8b 45 08             	mov    0x8(%ebp),%eax
  800b22:	ff d0                	call   *%eax
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  800b24:	8b 45 10             	mov    0x10(%ebp),%eax
  800b27:	8d 50 01             	lea    0x1(%eax),%edx
  800b2a:	89 55 10             	mov    %edx,0x10(%ebp)
  800b2d:	0f b6 00             	movzbl (%eax),%eax
  800b30:	0f b6 d8             	movzbl %al,%ebx
  800b33:	83 fb 25             	cmp    $0x25,%ebx
  800b36:	75 d5                	jne    800b0d <vprintfmt+0xe>
        }

        // Process a %-escape sequence
        char padc = ' ';
  800b38:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
  800b3c:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
  800b43:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  800b46:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
  800b49:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  800b50:	8b 45 dc             	mov    -0x24(%ebp),%eax
  800b53:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
  800b56:	8b 45 10             	mov    0x10(%ebp),%eax
  800b59:	8d 50 01             	lea    0x1(%eax),%edx
  800b5c:	89 55 10             	mov    %edx,0x10(%ebp)
  800b5f:	0f b6 00             	movzbl (%eax),%eax
  800b62:	0f b6 d8             	movzbl %al,%ebx
  800b65:	8d 43 dd             	lea    -0x23(%ebx),%eax
  800b68:	83 f8 55             	cmp    $0x55,%eax
  800b6b:	0f 87 38 03 00 00    	ja     800ea9 <vprintfmt+0x3aa>
  800b71:	8b 04 85 a8 13 80 00 	mov    0x8013a8(,%eax,4),%eax
  800b78:	3e ff e0             	notrack jmp *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
  800b7b:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
  800b7f:	eb d5                	jmp    800b56 <vprintfmt+0x57>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
  800b81:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
  800b85:	eb cf                	jmp    800b56 <vprintfmt+0x57>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
  800b87:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
  800b8e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  800b91:	89 d0                	mov    %edx,%eax
  800b93:	c1 e0 02             	shl    $0x2,%eax
  800b96:	01 d0                	add    %edx,%eax
  800b98:	01 c0                	add    %eax,%eax
  800b9a:	01 d8                	add    %ebx,%eax
  800b9c:	83 e8 30             	sub    $0x30,%eax
  800b9f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
  800ba2:	8b 45 10             	mov    0x10(%ebp),%eax
  800ba5:	0f b6 00             	movzbl (%eax),%eax
  800ba8:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
  800bab:	83 fb 2f             	cmp    $0x2f,%ebx
  800bae:	7e 38                	jle    800be8 <vprintfmt+0xe9>
  800bb0:	83 fb 39             	cmp    $0x39,%ebx
  800bb3:	7f 33                	jg     800be8 <vprintfmt+0xe9>
            for (precision = 0; ; ++ fmt) {
  800bb5:	ff 45 10             	incl   0x10(%ebp)
                precision = precision * 10 + ch - '0';
  800bb8:	eb d4                	jmp    800b8e <vprintfmt+0x8f>
                }
            }
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
  800bba:	8b 45 14             	mov    0x14(%ebp),%eax
  800bbd:	8d 50 04             	lea    0x4(%eax),%edx
  800bc0:	89 55 14             	mov    %edx,0x14(%ebp)
  800bc3:	8b 00                	mov    (%eax),%eax
  800bc5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
  800bc8:	eb 1f                	jmp    800be9 <vprintfmt+0xea>

        case '.':
            if (width < 0)
  800bca:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  800bce:	79 86                	jns    800b56 <vprintfmt+0x57>
                width = 0;
  800bd0:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
  800bd7:	e9 7a ff ff ff       	jmp    800b56 <vprintfmt+0x57>

        case '#':
            altflag = 1;
  800bdc:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
  800be3:	e9 6e ff ff ff       	jmp    800b56 <vprintfmt+0x57>
            goto process_precision;
  800be8:	90                   	nop

        process_precision:
            if (width < 0)
  800be9:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  800bed:	0f 89 63 ff ff ff    	jns    800b56 <vprintfmt+0x57>
                width = precision, precision = -1;
  800bf3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  800bf6:	89 45 e8             	mov    %eax,-0x18(%ebp)
  800bf9:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
  800c00:	e9 51 ff ff ff       	jmp    800b56 <vprintfmt+0x57>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
  800c05:	ff 45 e0             	incl   -0x20(%ebp)
            goto reswitch;
  800c08:	e9 49 ff ff ff       	jmp    800b56 <vprintfmt+0x57>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
  800c0d:	8b 45 14             	mov    0x14(%ebp),%eax
  800c10:	8d 50 04             	lea    0x4(%eax),%edx
  800c13:	89 55 14             	mov    %edx,0x14(%ebp)
  800c16:	8b 00                	mov    (%eax),%eax
  800c18:	8b 55 0c             	mov    0xc(%ebp),%edx
  800c1b:	89 54 24 04          	mov    %edx,0x4(%esp)
  800c1f:	89 04 24             	mov    %eax,(%esp)
  800c22:	8b 45 08             	mov    0x8(%ebp),%eax
  800c25:	ff d0                	call   *%eax
            break;
  800c27:	e9 a4 02 00 00       	jmp    800ed0 <vprintfmt+0x3d1>

        // error message
        case 'e':
            err = va_arg(ap, int);
  800c2c:	8b 45 14             	mov    0x14(%ebp),%eax
  800c2f:	8d 50 04             	lea    0x4(%eax),%edx
  800c32:	89 55 14             	mov    %edx,0x14(%ebp)
  800c35:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
  800c37:	85 db                	test   %ebx,%ebx
  800c39:	79 02                	jns    800c3d <vprintfmt+0x13e>
                err = -err;
  800c3b:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
  800c3d:	83 fb 18             	cmp    $0x18,%ebx
  800c40:	7f 0b                	jg     800c4d <vprintfmt+0x14e>
  800c42:	8b 34 9d 20 13 80 00 	mov    0x801320(,%ebx,4),%esi
  800c49:	85 f6                	test   %esi,%esi
  800c4b:	75 23                	jne    800c70 <vprintfmt+0x171>
                printfmt(putch, putdat, "error %d", err);
  800c4d:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  800c51:	c7 44 24 08 95 13 80 	movl   $0x801395,0x8(%esp)
  800c58:	00 
  800c59:	8b 45 0c             	mov    0xc(%ebp),%eax
  800c5c:	89 44 24 04          	mov    %eax,0x4(%esp)
  800c60:	8b 45 08             	mov    0x8(%ebp),%eax
  800c63:	89 04 24             	mov    %eax,(%esp)
  800c66:	e8 61 fe ff ff       	call   800acc <printfmt>
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
  800c6b:	e9 60 02 00 00       	jmp    800ed0 <vprintfmt+0x3d1>
                printfmt(putch, putdat, "%s", p);
  800c70:	89 74 24 0c          	mov    %esi,0xc(%esp)
  800c74:	c7 44 24 08 9e 13 80 	movl   $0x80139e,0x8(%esp)
  800c7b:	00 
  800c7c:	8b 45 0c             	mov    0xc(%ebp),%eax
  800c7f:	89 44 24 04          	mov    %eax,0x4(%esp)
  800c83:	8b 45 08             	mov    0x8(%ebp),%eax
  800c86:	89 04 24             	mov    %eax,(%esp)
  800c89:	e8 3e fe ff ff       	call   800acc <printfmt>
            break;
  800c8e:	e9 3d 02 00 00       	jmp    800ed0 <vprintfmt+0x3d1>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
  800c93:	8b 45 14             	mov    0x14(%ebp),%eax
  800c96:	8d 50 04             	lea    0x4(%eax),%edx
  800c99:	89 55 14             	mov    %edx,0x14(%ebp)
  800c9c:	8b 30                	mov    (%eax),%esi
  800c9e:	85 f6                	test   %esi,%esi
  800ca0:	75 05                	jne    800ca7 <vprintfmt+0x1a8>
                p = "(null)";
  800ca2:	be a1 13 80 00       	mov    $0x8013a1,%esi
            }
            if (width > 0 && padc != '-') {
  800ca7:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  800cab:	7e 76                	jle    800d23 <vprintfmt+0x224>
  800cad:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
  800cb1:	74 70                	je     800d23 <vprintfmt+0x224>
                for (width -= strnlen(p, precision); width > 0; width --) {
  800cb3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  800cb6:	89 44 24 04          	mov    %eax,0x4(%esp)
  800cba:	89 34 24             	mov    %esi,(%esp)
  800cbd:	e8 ba f7 ff ff       	call   80047c <strnlen>
  800cc2:	8b 55 e8             	mov    -0x18(%ebp),%edx
  800cc5:	29 c2                	sub    %eax,%edx
  800cc7:	89 d0                	mov    %edx,%eax
  800cc9:	89 45 e8             	mov    %eax,-0x18(%ebp)
  800ccc:	eb 16                	jmp    800ce4 <vprintfmt+0x1e5>
                    putch(padc, putdat);
  800cce:	0f be 45 db          	movsbl -0x25(%ebp),%eax
  800cd2:	8b 55 0c             	mov    0xc(%ebp),%edx
  800cd5:	89 54 24 04          	mov    %edx,0x4(%esp)
  800cd9:	89 04 24             	mov    %eax,(%esp)
  800cdc:	8b 45 08             	mov    0x8(%ebp),%eax
  800cdf:	ff d0                	call   *%eax
                for (width -= strnlen(p, precision); width > 0; width --) {
  800ce1:	ff 4d e8             	decl   -0x18(%ebp)
  800ce4:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  800ce8:	7f e4                	jg     800cce <vprintfmt+0x1cf>
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  800cea:	eb 37                	jmp    800d23 <vprintfmt+0x224>
                if (altflag && (ch < ' ' || ch > '~')) {
  800cec:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  800cf0:	74 1f                	je     800d11 <vprintfmt+0x212>
  800cf2:	83 fb 1f             	cmp    $0x1f,%ebx
  800cf5:	7e 05                	jle    800cfc <vprintfmt+0x1fd>
  800cf7:	83 fb 7e             	cmp    $0x7e,%ebx
  800cfa:	7e 15                	jle    800d11 <vprintfmt+0x212>
                    putch('?', putdat);
  800cfc:	8b 45 0c             	mov    0xc(%ebp),%eax
  800cff:	89 44 24 04          	mov    %eax,0x4(%esp)
  800d03:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
  800d0a:	8b 45 08             	mov    0x8(%ebp),%eax
  800d0d:	ff d0                	call   *%eax
  800d0f:	eb 0f                	jmp    800d20 <vprintfmt+0x221>
                }
                else {
                    putch(ch, putdat);
  800d11:	8b 45 0c             	mov    0xc(%ebp),%eax
  800d14:	89 44 24 04          	mov    %eax,0x4(%esp)
  800d18:	89 1c 24             	mov    %ebx,(%esp)
  800d1b:	8b 45 08             	mov    0x8(%ebp),%eax
  800d1e:	ff d0                	call   *%eax
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  800d20:	ff 4d e8             	decl   -0x18(%ebp)
  800d23:	89 f0                	mov    %esi,%eax
  800d25:	8d 70 01             	lea    0x1(%eax),%esi
  800d28:	0f b6 00             	movzbl (%eax),%eax
  800d2b:	0f be d8             	movsbl %al,%ebx
  800d2e:	85 db                	test   %ebx,%ebx
  800d30:	74 27                	je     800d59 <vprintfmt+0x25a>
  800d32:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  800d36:	78 b4                	js     800cec <vprintfmt+0x1ed>
  800d38:	ff 4d e4             	decl   -0x1c(%ebp)
  800d3b:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  800d3f:	79 ab                	jns    800cec <vprintfmt+0x1ed>
                }
            }
            for (; width > 0; width --) {
  800d41:	eb 16                	jmp    800d59 <vprintfmt+0x25a>
                putch(' ', putdat);
  800d43:	8b 45 0c             	mov    0xc(%ebp),%eax
  800d46:	89 44 24 04          	mov    %eax,0x4(%esp)
  800d4a:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  800d51:	8b 45 08             	mov    0x8(%ebp),%eax
  800d54:	ff d0                	call   *%eax
            for (; width > 0; width --) {
  800d56:	ff 4d e8             	decl   -0x18(%ebp)
  800d59:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  800d5d:	7f e4                	jg     800d43 <vprintfmt+0x244>
            }
            break;
  800d5f:	e9 6c 01 00 00       	jmp    800ed0 <vprintfmt+0x3d1>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
  800d64:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800d67:	89 44 24 04          	mov    %eax,0x4(%esp)
  800d6b:	8d 45 14             	lea    0x14(%ebp),%eax
  800d6e:	89 04 24             	mov    %eax,(%esp)
  800d71:	e8 0b fd ff ff       	call   800a81 <getint>
  800d76:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800d79:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
  800d7c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800d7f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800d82:	85 d2                	test   %edx,%edx
  800d84:	79 26                	jns    800dac <vprintfmt+0x2ad>
                putch('-', putdat);
  800d86:	8b 45 0c             	mov    0xc(%ebp),%eax
  800d89:	89 44 24 04          	mov    %eax,0x4(%esp)
  800d8d:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
  800d94:	8b 45 08             	mov    0x8(%ebp),%eax
  800d97:	ff d0                	call   *%eax
                num = -(long long)num;
  800d99:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800d9c:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800d9f:	f7 d8                	neg    %eax
  800da1:	83 d2 00             	adc    $0x0,%edx
  800da4:	f7 da                	neg    %edx
  800da6:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800da9:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
  800dac:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  800db3:	e9 a8 00 00 00       	jmp    800e60 <vprintfmt+0x361>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
  800db8:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800dbb:	89 44 24 04          	mov    %eax,0x4(%esp)
  800dbf:	8d 45 14             	lea    0x14(%ebp),%eax
  800dc2:	89 04 24             	mov    %eax,(%esp)
  800dc5:	e8 64 fc ff ff       	call   800a2e <getuint>
  800dca:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800dcd:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
  800dd0:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  800dd7:	e9 84 00 00 00       	jmp    800e60 <vprintfmt+0x361>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
  800ddc:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800ddf:	89 44 24 04          	mov    %eax,0x4(%esp)
  800de3:	8d 45 14             	lea    0x14(%ebp),%eax
  800de6:	89 04 24             	mov    %eax,(%esp)
  800de9:	e8 40 fc ff ff       	call   800a2e <getuint>
  800dee:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800df1:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
  800df4:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
  800dfb:	eb 63                	jmp    800e60 <vprintfmt+0x361>

        // pointer
        case 'p':
            putch('0', putdat);
  800dfd:	8b 45 0c             	mov    0xc(%ebp),%eax
  800e00:	89 44 24 04          	mov    %eax,0x4(%esp)
  800e04:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
  800e0b:	8b 45 08             	mov    0x8(%ebp),%eax
  800e0e:	ff d0                	call   *%eax
            putch('x', putdat);
  800e10:	8b 45 0c             	mov    0xc(%ebp),%eax
  800e13:	89 44 24 04          	mov    %eax,0x4(%esp)
  800e17:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
  800e1e:	8b 45 08             	mov    0x8(%ebp),%eax
  800e21:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
  800e23:	8b 45 14             	mov    0x14(%ebp),%eax
  800e26:	8d 50 04             	lea    0x4(%eax),%edx
  800e29:	89 55 14             	mov    %edx,0x14(%ebp)
  800e2c:	8b 00                	mov    (%eax),%eax
  800e2e:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800e31:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
  800e38:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
  800e3f:	eb 1f                	jmp    800e60 <vprintfmt+0x361>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
  800e41:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800e44:	89 44 24 04          	mov    %eax,0x4(%esp)
  800e48:	8d 45 14             	lea    0x14(%ebp),%eax
  800e4b:	89 04 24             	mov    %eax,(%esp)
  800e4e:	e8 db fb ff ff       	call   800a2e <getuint>
  800e53:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800e56:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
  800e59:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
  800e60:	0f be 55 db          	movsbl -0x25(%ebp),%edx
  800e64:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800e67:	89 54 24 18          	mov    %edx,0x18(%esp)
  800e6b:	8b 55 e8             	mov    -0x18(%ebp),%edx
  800e6e:	89 54 24 14          	mov    %edx,0x14(%esp)
  800e72:	89 44 24 10          	mov    %eax,0x10(%esp)
  800e76:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800e79:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800e7c:	89 44 24 08          	mov    %eax,0x8(%esp)
  800e80:	89 54 24 0c          	mov    %edx,0xc(%esp)
  800e84:	8b 45 0c             	mov    0xc(%ebp),%eax
  800e87:	89 44 24 04          	mov    %eax,0x4(%esp)
  800e8b:	8b 45 08             	mov    0x8(%ebp),%eax
  800e8e:	89 04 24             	mov    %eax,(%esp)
  800e91:	e8 94 fa ff ff       	call   80092a <printnum>
            break;
  800e96:	eb 38                	jmp    800ed0 <vprintfmt+0x3d1>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
  800e98:	8b 45 0c             	mov    0xc(%ebp),%eax
  800e9b:	89 44 24 04          	mov    %eax,0x4(%esp)
  800e9f:	89 1c 24             	mov    %ebx,(%esp)
  800ea2:	8b 45 08             	mov    0x8(%ebp),%eax
  800ea5:	ff d0                	call   *%eax
            break;
  800ea7:	eb 27                	jmp    800ed0 <vprintfmt+0x3d1>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
  800ea9:	8b 45 0c             	mov    0xc(%ebp),%eax
  800eac:	89 44 24 04          	mov    %eax,0x4(%esp)
  800eb0:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
  800eb7:	8b 45 08             	mov    0x8(%ebp),%eax
  800eba:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
  800ebc:	ff 4d 10             	decl   0x10(%ebp)
  800ebf:	eb 03                	jmp    800ec4 <vprintfmt+0x3c5>
  800ec1:	ff 4d 10             	decl   0x10(%ebp)
  800ec4:	8b 45 10             	mov    0x10(%ebp),%eax
  800ec7:	48                   	dec    %eax
  800ec8:	0f b6 00             	movzbl (%eax),%eax
  800ecb:	3c 25                	cmp    $0x25,%al
  800ecd:	75 f2                	jne    800ec1 <vprintfmt+0x3c2>
                /* do nothing */;
            break;
  800ecf:	90                   	nop
    while (1) {
  800ed0:	e9 36 fc ff ff       	jmp    800b0b <vprintfmt+0xc>
                return;
  800ed5:	90                   	nop
        }
    }
}
  800ed6:	83 c4 40             	add    $0x40,%esp
  800ed9:	5b                   	pop    %ebx
  800eda:	5e                   	pop    %esi
  800edb:	5d                   	pop    %ebp
  800edc:	c3                   	ret    

00800edd <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
  800edd:	f3 0f 1e fb          	endbr32 
  800ee1:	55                   	push   %ebp
  800ee2:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
  800ee4:	8b 45 0c             	mov    0xc(%ebp),%eax
  800ee7:	8b 40 08             	mov    0x8(%eax),%eax
  800eea:	8d 50 01             	lea    0x1(%eax),%edx
  800eed:	8b 45 0c             	mov    0xc(%ebp),%eax
  800ef0:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
  800ef3:	8b 45 0c             	mov    0xc(%ebp),%eax
  800ef6:	8b 10                	mov    (%eax),%edx
  800ef8:	8b 45 0c             	mov    0xc(%ebp),%eax
  800efb:	8b 40 04             	mov    0x4(%eax),%eax
  800efe:	39 c2                	cmp    %eax,%edx
  800f00:	73 12                	jae    800f14 <sprintputch+0x37>
        *b->buf ++ = ch;
  800f02:	8b 45 0c             	mov    0xc(%ebp),%eax
  800f05:	8b 00                	mov    (%eax),%eax
  800f07:	8d 48 01             	lea    0x1(%eax),%ecx
  800f0a:	8b 55 0c             	mov    0xc(%ebp),%edx
  800f0d:	89 0a                	mov    %ecx,(%edx)
  800f0f:	8b 55 08             	mov    0x8(%ebp),%edx
  800f12:	88 10                	mov    %dl,(%eax)
    }
}
  800f14:	90                   	nop
  800f15:	5d                   	pop    %ebp
  800f16:	c3                   	ret    

00800f17 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
  800f17:	f3 0f 1e fb          	endbr32 
  800f1b:	55                   	push   %ebp
  800f1c:	89 e5                	mov    %esp,%ebp
  800f1e:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
  800f21:	8d 45 14             	lea    0x14(%ebp),%eax
  800f24:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
  800f27:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800f2a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800f2e:	8b 45 10             	mov    0x10(%ebp),%eax
  800f31:	89 44 24 08          	mov    %eax,0x8(%esp)
  800f35:	8b 45 0c             	mov    0xc(%ebp),%eax
  800f38:	89 44 24 04          	mov    %eax,0x4(%esp)
  800f3c:	8b 45 08             	mov    0x8(%ebp),%eax
  800f3f:	89 04 24             	mov    %eax,(%esp)
  800f42:	e8 08 00 00 00       	call   800f4f <vsnprintf>
  800f47:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
  800f4a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  800f4d:	c9                   	leave  
  800f4e:	c3                   	ret    

00800f4f <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
  800f4f:	f3 0f 1e fb          	endbr32 
  800f53:	55                   	push   %ebp
  800f54:	89 e5                	mov    %esp,%ebp
  800f56:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
  800f59:	8b 45 08             	mov    0x8(%ebp),%eax
  800f5c:	89 45 ec             	mov    %eax,-0x14(%ebp)
  800f5f:	8b 45 0c             	mov    0xc(%ebp),%eax
  800f62:	8d 50 ff             	lea    -0x1(%eax),%edx
  800f65:	8b 45 08             	mov    0x8(%ebp),%eax
  800f68:	01 d0                	add    %edx,%eax
  800f6a:	89 45 f0             	mov    %eax,-0x10(%ebp)
  800f6d:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
  800f74:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  800f78:	74 0a                	je     800f84 <vsnprintf+0x35>
  800f7a:	8b 55 ec             	mov    -0x14(%ebp),%edx
  800f7d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800f80:	39 c2                	cmp    %eax,%edx
  800f82:	76 07                	jbe    800f8b <vsnprintf+0x3c>
        return -E_INVAL;
  800f84:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f89:	eb 2a                	jmp    800fb5 <vsnprintf+0x66>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
  800f8b:	8b 45 14             	mov    0x14(%ebp),%eax
  800f8e:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800f92:	8b 45 10             	mov    0x10(%ebp),%eax
  800f95:	89 44 24 08          	mov    %eax,0x8(%esp)
  800f99:	8d 45 ec             	lea    -0x14(%ebp),%eax
  800f9c:	89 44 24 04          	mov    %eax,0x4(%esp)
  800fa0:	c7 04 24 dd 0e 80 00 	movl   $0x800edd,(%esp)
  800fa7:	e8 53 fb ff ff       	call   800aff <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
  800fac:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800faf:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
  800fb2:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  800fb5:	c9                   	leave  
  800fb6:	c3                   	ret    

00800fb7 <hash32>:
 * @bits:   the number of bits in a return value
 *
 * High bits are more random, so we use them.
 * */
uint32_t
hash32(uint32_t val, unsigned int bits) {
  800fb7:	f3 0f 1e fb          	endbr32 
  800fbb:	55                   	push   %ebp
  800fbc:	89 e5                	mov    %esp,%ebp
  800fbe:	83 ec 10             	sub    $0x10,%esp
    uint32_t hash = val * GOLDEN_RATIO_PRIME_32;
  800fc1:	8b 45 08             	mov    0x8(%ebp),%eax
  800fc4:	69 c0 01 00 37 9e    	imul   $0x9e370001,%eax,%eax
  800fca:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return (hash >> (32 - bits));
  800fcd:	b8 20 00 00 00       	mov    $0x20,%eax
  800fd2:	2b 45 0c             	sub    0xc(%ebp),%eax
  800fd5:	8b 55 fc             	mov    -0x4(%ebp),%edx
  800fd8:	88 c1                	mov    %al,%cl
  800fda:	d3 ea                	shr    %cl,%edx
  800fdc:	89 d0                	mov    %edx,%eax
}
  800fde:	c9                   	leave  
  800fdf:	c3                   	ret    

00800fe0 <rand>:
 * rand - returns a pseudo-random integer
 *
 * The rand() function return a value in the range [0, RAND_MAX].
 * */
int
rand(void) {
  800fe0:	f3 0f 1e fb          	endbr32 
  800fe4:	55                   	push   %ebp
  800fe5:	89 e5                	mov    %esp,%ebp
  800fe7:	57                   	push   %edi
  800fe8:	56                   	push   %esi
  800fe9:	53                   	push   %ebx
  800fea:	83 ec 24             	sub    $0x24,%esp
    next = (next * 0x5DEECE66DLL + 0xBLL) & ((1LL << 48) - 1);
  800fed:	a1 00 20 80 00       	mov    0x802000,%eax
  800ff2:	8b 15 04 20 80 00    	mov    0x802004,%edx
  800ff8:	69 fa 6d e6 ec de    	imul   $0xdeece66d,%edx,%edi
  800ffe:	6b f0 05             	imul   $0x5,%eax,%esi
  801001:	01 fe                	add    %edi,%esi
  801003:	bf 6d e6 ec de       	mov    $0xdeece66d,%edi
  801008:	f7 e7                	mul    %edi
  80100a:	01 d6                	add    %edx,%esi
  80100c:	89 f2                	mov    %esi,%edx
  80100e:	83 c0 0b             	add    $0xb,%eax
  801011:	83 d2 00             	adc    $0x0,%edx
  801014:	89 c7                	mov    %eax,%edi
  801016:	83 e7 ff             	and    $0xffffffff,%edi
  801019:	89 f9                	mov    %edi,%ecx
  80101b:	0f b7 da             	movzwl %dx,%ebx
  80101e:	89 0d 00 20 80 00    	mov    %ecx,0x802000
  801024:	89 1d 04 20 80 00    	mov    %ebx,0x802004
    unsigned long long result = (next >> 12);
  80102a:	a1 00 20 80 00       	mov    0x802000,%eax
  80102f:	8b 15 04 20 80 00    	mov    0x802004,%edx
  801035:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
  801039:	c1 ea 0c             	shr    $0xc,%edx
  80103c:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80103f:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return (int)do_div(result, RAND_MAX + 1);
  801042:	c7 45 dc 00 00 00 80 	movl   $0x80000000,-0x24(%ebp)
  801049:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80104c:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80104f:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801052:	89 55 e8             	mov    %edx,-0x18(%ebp)
  801055:	8b 45 e8             	mov    -0x18(%ebp),%eax
  801058:	89 45 ec             	mov    %eax,-0x14(%ebp)
  80105b:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  80105f:	74 1c                	je     80107d <rand+0x9d>
  801061:	8b 45 e8             	mov    -0x18(%ebp),%eax
  801064:	ba 00 00 00 00       	mov    $0x0,%edx
  801069:	f7 75 dc             	divl   -0x24(%ebp)
  80106c:	89 55 ec             	mov    %edx,-0x14(%ebp)
  80106f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  801072:	ba 00 00 00 00       	mov    $0x0,%edx
  801077:	f7 75 dc             	divl   -0x24(%ebp)
  80107a:	89 45 e8             	mov    %eax,-0x18(%ebp)
  80107d:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801080:	8b 55 ec             	mov    -0x14(%ebp),%edx
  801083:	f7 75 dc             	divl   -0x24(%ebp)
  801086:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801089:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  80108c:	8b 45 d8             	mov    -0x28(%ebp),%eax
  80108f:	8b 55 e8             	mov    -0x18(%ebp),%edx
  801092:	89 45 e0             	mov    %eax,-0x20(%ebp)
  801095:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  801098:	8b 45 d4             	mov    -0x2c(%ebp),%eax
}
  80109b:	83 c4 24             	add    $0x24,%esp
  80109e:	5b                   	pop    %ebx
  80109f:	5e                   	pop    %esi
  8010a0:	5f                   	pop    %edi
  8010a1:	5d                   	pop    %ebp
  8010a2:	c3                   	ret    

008010a3 <srand>:
/* *
 * srand - seed the random number generator with the given number
 * @seed:   the required seed number
 * */
void
srand(unsigned int seed) {
  8010a3:	f3 0f 1e fb          	endbr32 
  8010a7:	55                   	push   %ebp
  8010a8:	89 e5                	mov    %esp,%ebp
    next = seed;
  8010aa:	8b 45 08             	mov    0x8(%ebp),%eax
  8010ad:	ba 00 00 00 00       	mov    $0x0,%edx
  8010b2:	a3 00 20 80 00       	mov    %eax,0x802000
  8010b7:	89 15 04 20 80 00    	mov    %edx,0x802004
}
  8010bd:	90                   	nop
  8010be:	5d                   	pop    %ebp
  8010bf:	c3                   	ret    

008010c0 <main>:
#include <stdio.h>
#include <ulib.h>

int
main(void) {
  8010c0:	f3 0f 1e fb          	endbr32 
  8010c4:	55                   	push   %ebp
  8010c5:	89 e5                	mov    %esp,%ebp
  8010c7:	83 e4 f0             	and    $0xfffffff0,%esp
  8010ca:	83 ec 20             	sub    $0x20,%esp
    int pid, exit_code;
    if ((pid = fork()) == 0) {
  8010cd:	e8 9f f1 ff ff       	call   800271 <fork>
  8010d2:	89 44 24 18          	mov    %eax,0x18(%esp)
  8010d6:	83 7c 24 18 00       	cmpl   $0x0,0x18(%esp)
  8010db:	75 32                	jne    80110f <main+0x4f>
        cprintf("fork ok.\n");
  8010dd:	c7 04 24 00 15 80 00 	movl   $0x801500,(%esp)
  8010e4:	e8 ce f2 ff ff       	call   8003b7 <cprintf>
        int i;
        for (i = 0; i < 10; i ++) {
  8010e9:	c7 44 24 1c 00 00 00 	movl   $0x0,0x1c(%esp)
  8010f0:	00 
  8010f1:	eb 09                	jmp    8010fc <main+0x3c>
            yield();
  8010f3:	e8 c8 f1 ff ff       	call   8002c0 <yield>
        for (i = 0; i < 10; i ++) {
  8010f8:	ff 44 24 1c          	incl   0x1c(%esp)
  8010fc:	83 7c 24 1c 09       	cmpl   $0x9,0x1c(%esp)
  801101:	7e f0                	jle    8010f3 <main+0x33>
        }
        exit(0xbeaf);
  801103:	c7 04 24 af be 00 00 	movl   $0xbeaf,(%esp)
  80110a:	e8 3f f1 ff ff       	call   80024e <exit>
    }
    assert(pid > 0);
  80110f:	83 7c 24 18 00       	cmpl   $0x0,0x18(%esp)
  801114:	7f 24                	jg     80113a <main+0x7a>
  801116:	c7 44 24 0c 0a 15 80 	movl   $0x80150a,0xc(%esp)
  80111d:	00 
  80111e:	c7 44 24 08 12 15 80 	movl   $0x801512,0x8(%esp)
  801125:	00 
  801126:	c7 44 24 04 0f 00 00 	movl   $0xf,0x4(%esp)
  80112d:	00 
  80112e:	c7 04 24 27 15 80 00 	movl   $0x801527,(%esp)
  801135:	e8 e6 ee ff ff       	call   800020 <__panic>
    assert(waitpid(-1, NULL) != 0);
  80113a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  801141:	00 
  801142:	c7 04 24 ff ff ff ff 	movl   $0xffffffff,(%esp)
  801149:	e8 54 f1 ff ff       	call   8002a2 <waitpid>
  80114e:	85 c0                	test   %eax,%eax
  801150:	75 24                	jne    801176 <main+0xb6>
  801152:	c7 44 24 0c 35 15 80 	movl   $0x801535,0xc(%esp)
  801159:	00 
  80115a:	c7 44 24 08 12 15 80 	movl   $0x801512,0x8(%esp)
  801161:	00 
  801162:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
  801169:	00 
  80116a:	c7 04 24 27 15 80 00 	movl   $0x801527,(%esp)
  801171:	e8 aa ee ff ff       	call   800020 <__panic>
    assert(waitpid(pid, (void *)0xC0000000) != 0);
  801176:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
  80117d:	c0 
  80117e:	8b 44 24 18          	mov    0x18(%esp),%eax
  801182:	89 04 24             	mov    %eax,(%esp)
  801185:	e8 18 f1 ff ff       	call   8002a2 <waitpid>
  80118a:	85 c0                	test   %eax,%eax
  80118c:	75 24                	jne    8011b2 <main+0xf2>
  80118e:	c7 44 24 0c 4c 15 80 	movl   $0x80154c,0xc(%esp)
  801195:	00 
  801196:	c7 44 24 08 12 15 80 	movl   $0x801512,0x8(%esp)
  80119d:	00 
  80119e:	c7 44 24 04 11 00 00 	movl   $0x11,0x4(%esp)
  8011a5:	00 
  8011a6:	c7 04 24 27 15 80 00 	movl   $0x801527,(%esp)
  8011ad:	e8 6e ee ff ff       	call   800020 <__panic>
    assert(waitpid(pid, &exit_code) == 0 && exit_code == 0xbeaf);
  8011b2:	8d 44 24 14          	lea    0x14(%esp),%eax
  8011b6:	89 44 24 04          	mov    %eax,0x4(%esp)
  8011ba:	8b 44 24 18          	mov    0x18(%esp),%eax
  8011be:	89 04 24             	mov    %eax,(%esp)
  8011c1:	e8 dc f0 ff ff       	call   8002a2 <waitpid>
  8011c6:	85 c0                	test   %eax,%eax
  8011c8:	75 0b                	jne    8011d5 <main+0x115>
  8011ca:	8b 44 24 14          	mov    0x14(%esp),%eax
  8011ce:	3d af be 00 00       	cmp    $0xbeaf,%eax
  8011d3:	74 24                	je     8011f9 <main+0x139>
  8011d5:	c7 44 24 0c 74 15 80 	movl   $0x801574,0xc(%esp)
  8011dc:	00 
  8011dd:	c7 44 24 08 12 15 80 	movl   $0x801512,0x8(%esp)
  8011e4:	00 
  8011e5:	c7 44 24 04 12 00 00 	movl   $0x12,0x4(%esp)
  8011ec:	00 
  8011ed:	c7 04 24 27 15 80 00 	movl   $0x801527,(%esp)
  8011f4:	e8 27 ee ff ff       	call   800020 <__panic>
    cprintf("badarg pass.\n");
  8011f9:	c7 04 24 a9 15 80 00 	movl   $0x8015a9,(%esp)
  801200:	e8 b2 f1 ff ff       	call   8003b7 <cprintf>
    return 0;
  801205:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80120a:	c9                   	leave  
  80120b:	c3                   	ret    
